<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.0.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/wang-cheng/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/wang-cheng/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/wang-cheng/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/wang-cheng/images/logo.svg" color="#222">

<link rel="stylesheet" href="/wang-cheng/css/main.css">


<link rel="stylesheet" href="/wang-cheng/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"cheng-wang123.gitee.io","root":"/wang-cheng/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="面试题第一天Java类加载器有哪些JDK自带的三个类加载器：bootstrap ClassLoader、ExtClassLoader、AppClassLoader BootstrapClassLoader是ExtClassLoader的父类加载器(不是继承关系，而是在ExtClassLoader中有一个Private属性parent，指向BootstrapClassLoader),默认负责加载%J">
<meta property="og:type" content="article">
<meta property="og:title" content="面试题(一)">
<meta property="og:url" content="https://cheng-wang123.gitee.io/wang-cheng/2022/03/18/%E9%9D%A2%E8%AF%95%E9%A2%98-%E4%B8%80/index.html">
<meta property="og:site_name" content="诚の博客">
<meta property="og:description" content="面试题第一天Java类加载器有哪些JDK自带的三个类加载器：bootstrap ClassLoader、ExtClassLoader、AppClassLoader BootstrapClassLoader是ExtClassLoader的父类加载器(不是继承关系，而是在ExtClassLoader中有一个Private属性parent，指向BootstrapClassLoader),默认负责加载%J">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-03-18T03:18:17.000Z">
<meta property="article:modified_time" content="2022-03-25T02:38:20.968Z">
<meta property="article:author" content="王诚">
<meta property="article:tag" content="面试题">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://cheng-wang123.gitee.io/wang-cheng/2022/03/18/%E9%9D%A2%E8%AF%95%E9%A2%98-%E4%B8%80/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>面试题(一) | 诚の博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/wang-cheng/atom.xml" title="诚の博客" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/wang-cheng/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">诚の博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">记录学习中的点点滴滴</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/wang-cheng/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/wang-cheng/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/wang-cheng/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/wang-cheng/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://cheng-wang123.gitee.io/wang-cheng/2022/03/18/%E9%9D%A2%E8%AF%95%E9%A2%98-%E4%B8%80/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/wang-cheng/images/avatar.gif">
      <meta itemprop="name" content="王诚">
      <meta itemprop="description" content="命运对勇士低语，你无法抵御风暴；勇士低声回应，我就是风暴">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="诚の博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          面试题(一)
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-18 11:18:17" itemprop="dateCreated datePublished" datetime="2022-03-18T11:18:17+08:00">2022-03-18</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-03-25 10:38:20" itemprop="dateModified" datetime="2022-03-25T10:38:20+08:00">2022-03-25</time>
              </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="面试题"><a href="#面试题" class="headerlink" title="面试题"></a><strong>面试题</strong></h1><h2 id="第一天"><a href="#第一天" class="headerlink" title="第一天"></a><strong>第一天</strong></h2><h3 id="Java类加载器有哪些"><a href="#Java类加载器有哪些" class="headerlink" title="Java类加载器有哪些"></a><strong>Java类加载器有哪些</strong></h3><p>JDK自带的三个类加载器：bootstrap ClassLoader、ExtClassLoader、AppClassLoader</p>
<p>BootstrapClassLoader是ExtClassLoader的父类加载器(不是继承关系，而是在ExtClassLoader中有一个Private属性parent，指向BootstrapClassLoader),默认负责加载%JAVA_HOME%&#x2F;lib下的jar包和class文件。</p>
<p>ExtClassLoader是AppClassLoader的父类加载器，负责加载%JAVA_HOME%lib&#x2F;ext文件夹下的jar包和class类。</p>
<p>AppClassLoader是自定义类加载器的父类，负责加载classpath下的类文件，是系统类加载器(classpath下的类——程序员写的类)、线程上下文加载器(贯穿BootStrapClassLoader、ExtClassLoader、AppClassLoader，这三个类加载器都可以去访问线程上下文类加载器)</p>
<p>(继承ClassLoader实现自定义类加载器)</p>
<h3 id="JDK、JRE、JVM三者区别和联系"><a href="#JDK、JRE、JVM三者区别和联系" class="headerlink" title="JDK、JRE、JVM三者区别和联系"></a><strong>JDK、JRE、JVM三者区别和联系</strong></h3><p>JDK:Java Develpment Kit  java开发工具</p>
<p>JRE:Runtime Enviroment Java运行时环境</p>
<p>JVM:Java Virtual Machine Java虚拟机</p>
<p><strong>JDK包括JRE和Java工具(javac、java、jconsole等开发工具)</strong></p>
<p><strong>JRE包括bin(jvm)、lib(类库)</strong></p>
<p>流程：</p>
<p>.java文件–javac编译–&gt;.class文件—–&gt;windows版&#x2F;linux版jvm—调用类库(JRE下面的lib)解释器解释class成为–&gt;机器码—-&gt;Windows&#x2F;linux运行</p>
<h3 id="x3D-x3D-和equals"><a href="#x3D-x3D-和equals" class="headerlink" title="&#x3D;&#x3D;和equals"></a><strong>&#x3D;&#x3D;和equals</strong></h3><p>&#x3D;&#x3D;对比的是栈中的值，基本数据类型是变量值，引用类型是堆中内存对象的地址</p>
<p>equals：object默认也是采用&#x3D;&#x3D;比较，通常会重写(String类型已经重写了equals方法，所以当比较两个String类型对象时，不是返回false而是返回true。也就是说，String类中被复写的equals()方法其实是比较两个字符串的内容)</p>
<p>String str1 &#x3D; “hello” &#x2F;&#x2F;str1是被定义到常量池中</p>
<p>String str2 &#x3D; new String(“hello”) &#x2F;&#x2F;str2 是被定义到堆中</p>
<p>String str3 &#x3D; str2 &#x2F;&#x2F;引用传递</p>
<p>str1 &#x3D;&#x3D; str2  false</p>
<p>str1 &#x3D;&#x3D; str3 false</p>
<p>str2 &#x3D;&#x3D; str3 true</p>
<p>str1.equals(str2) true</p>
<p>str1.equals(str3) true</p>
<p>str2.equals(str3) true</p>
<hr>
<h3 id="final的作用、为什么局部内部类和匿名内部类只能访问局部final变量"><a href="#final的作用、为什么局部内部类和匿名内部类只能访问局部final变量" class="headerlink" title="final的作用、为什么局部内部类和匿名内部类只能访问局部final变量"></a><strong>final的作用、为什么局部内部类和匿名内部类只能访问局部final变量</strong></h3><h4 id="final的作用"><a href="#final的作用" class="headerlink" title="final的作用"></a><strong>final的作用</strong></h4><p>final:修饰类(类不可以被继承)、修饰方法(表示方法不可被子类覆盖，但是可以重载)、修饰变量(表示变量一旦被赋值就不可以更改它的值)</p>
<ol>
<li>修饰成员变量<ul>
<li>如果final修饰的是类变量(必须被static修饰)，只能在静态初始化块中指定初始值或者声明该类变量时指定初始值(例如:final int b &#x3D; 0)</li>
<li>如果final修饰的是成员变量(没有static修饰)，可以在非静态初始化块、声明该变量或者构造器中执行初始值</li>
</ul>
</li>
<li>修饰局部变量<ul>
<li>系统不会为局部变量进行初始化，局部变量必须由程序员显示初始化。因此使用final修饰局部变量时，即可以在定义时指定默认值(后面的代码不能再对变量赋值)，也可以不指定默认值，而在后面的代码中对final变量赋初值(仅一次)。</li>
</ul>
</li>
<li>修饰基本类型数据和引用类型数据<ul>
<li>如果时基本数据类型的变量，则其数值一旦在初始化之后不能再改</li>
<li>如果是引用数据类型的变量，则在对其初始化之后便不能再让其指向另一个对象。<strong>但是引用的值可以改变</strong>(可以修改指向对象的值，不可以修改指向的对象)。</li>
</ul>
</li>
</ol>
<h4 id="为什么局部内部类和匿名内部类只能访问局部final变量"><a href="#为什么局部内部类和匿名内部类只能访问局部final变量" class="headerlink" title="为什么局部内部类和匿名内部类只能访问局部final变量"></a><strong>为什么局部内部类和匿名内部类只能访问局部final变量</strong></h4><p>编译之后生成两个class文件——Test.class  Test1.class</p>
<figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title">Test</span>&#123;</span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span>(<span class="params">String[] args</span>)</span>&#123;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//局部内部类</span></span><br><span class="line">    <span class="comment">//局部final变量a,b</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">test</span>(<span class="params">final <span class="built_in">int</span> b</span>)</span>&#123;</span><br><span class="line">        final <span class="built_in">int</span> a = <span class="number">10</span>;</span><br><span class="line">        <span class="comment">//匿名内部类</span></span><br><span class="line">        <span class="keyword">new</span> Thread()&#123;</span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span>()</span>&#123;</span><br><span class="line">                System.<span class="keyword">out</span>.println(a);</span><br><span class="line">                System.<span class="keyword">out</span>.println(b);</span><br><span class="line">            &#125;;</span><br><span class="line">        &#125;.start();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">//a,b必须加final参数</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">class</span> <span class="title">Outclass</span>&#123;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="built_in">int</span> age = <span class="number">12</span>;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">outPrint</span>(<span class="params">final <span class="built_in">int</span> x</span>)</span>&#123;</span><br><span class="line">        <span class="comment">//局部内部类</span></span><br><span class="line">        Class InClass&#123;</span><br><span class="line">            <span class="function">pubic <span class="keyword">void</span> <span class="title">Inprint</span>()</span>&#123;</span><br><span class="line">                System.<span class="keyword">out</span>.println(x);</span><br><span class="line">                System.<span class="keyword">out</span>.println(age);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">new</span> InClass.Inprint();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>首先需要明确：内部类和外部类是处于同一个级别，内部类不会因为定义在方法中就会随着方法的执行完毕就被销毁</p>
<p>这里就产生一个问题：当外部类的方法结束时，局部变量就会被销毁了，但是内部类对象可能还存在(只有没有人再引用它时，才会死亡)。这里就出现了一个矛盾：内部类对象访问了一个不存在的变量。为了解决这个问题，就将局部变量复制了一份作为内部类的成员变量，这样当局部变量死亡后，内部类扔可以访问它，实际访问的是局部变量的“copy”。这样就好像延长了局部变量的生命周期。</p>
<p>将局部变量复制为内部类的成员变量时，必须保证这两个变量是一样的，也就是如果我们在内部类中修改了成员变量，方法中的局部变量也得跟着改变，怎么解决这个问题？</p>
<p>就将局部变量设置为final，对它初始化后，我就不让你再去修改这个变量，就保证了内部类的成员变量和方法的局部变量的一致性。这实际上也是一种妥协。使得局部变量与内部类建立的拷贝保持一直。</p>
<h3 id="String、StringBuffer、StringBuilder区别以及使用场景"><a href="#String、StringBuffer、StringBuilder区别以及使用场景" class="headerlink" title="String、StringBuffer、StringBuilder区别以及使用场景"></a><strong>String、StringBuffer、StringBuilder区别以及使用场景</strong></h3><p>String是final修饰的，不可变，每次操作都会产生新的String对象</p>
<p>StringBuffer和StringBuilder都是在原对象上操作</p>
<p>StringBuffer是线程安全的，StringBuilder线程不安全的</p>
<p>StringBuffer方法都是synchronized修饰的</p>
<p>性能：StringBuilder &gt; StringBuffer &gt; String</p>
<p>任何场景:经常需要改变字符串内容时使用后面两个(StringBuffer、StringBuilder)</p>
<p>优先使用StringBuilder,多线程使用共享变量时使用StringBuffer。</p>
<h3 id="重载和重写的区别"><a href="#重载和重写的区别" class="headerlink" title="重载和重写的区别"></a><strong>重载和重写的区别</strong></h3><p>重载:发生在同一个类中，方法名必须相同，参数类型不同、个数不同、顺序不同，方法返回值和访问修饰符可以不同，发生在编译时。<br>重写:发生在子父类，方法名、参数列表必须相同，返回值范围小于等于父类，抛出的异常范围小于等于父类，访问修饰符范围大于等于父类；如果父类方法访问修饰符为private，则子类就不能重写该方法</p>
<figure class="highlight processing"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="type">int</span> <span class="built_in">add</span>(<span class="type">int</span> a,<span class="built_in">String</span> b)</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="built_in">String</span> <span class="built_in">add</span>(<span class="type">int</span> a,<span class="built_in">String</span> b)</span><br><span class="line"><span class="comment">//编译报错</span></span><br><span class="line"><span class="comment">//因为只有当参数类型不同/个数不同/顺序不同时，才叫重载。</span></span><br><span class="line"><span class="comment">//如果这个方法是重载方法，那么方法返回值和访问修饰符可以不同。如果这个方法不是重载方法，则会报错。</span></span><br></pre></td></tr></table></figure>

<h3 id="接口和抽象类的区别"><a href="#接口和抽象类的区别" class="headerlink" title="接口和抽象类的区别"></a><strong>接口和抽象类的区别</strong></h3><ul>
<li>抽象类可以存在普通成员函数，而接口只能存在public abstract方法</li>
<li>抽象类中的成员变量可以是各种类型的，而接口中的成员变量只能是public static final类型的</li>
<li>抽象类只能继承一个，接口可以实现多个。</li>
</ul>
<p>接口的设计目的，是对类的行为进行约束(更准确说是一种“有”约束，因为接口不能规定类不可以有什么行为)，也就是提供一种机制，可以强制要求不同的类具有相同的行为。它只约束了行为的有无，但不对如何实现行为进行限制</p>
<p>而抽象类的设计目的，是代码复用，当不同的类具有某些相同的行为(记为行为集合A)，且其中一部分行为的实现方式一致时(A的非真子集，记为B)，可以让这些类都派生于一个抽象类(先有子类，再有父类。一些类的一些共性抽取出来组成一个父类，才存在一个抽象类)，在这个抽象类中实现了B(对B方法进行了实现，而在各个子类中不能再实现B方法了)，避免让所有子类都来实现B。而A-B的部分，留给各个子类自己实现。正是因为A-B在这里没有实现，所以抽象类不允许实例化出来(因为抽象类中没有实例化的方法A-B没有实现，所以如果将抽象类实例化出来的话，调用到A-B的方法时，程序将无法再继续执行了，如果想实例化抽象类，必须在实例化的同时实现A-B的方法，否则抽象类就只能用于继承了)。</p>
<p>抽象类是对类本质的抽象，表达的是is a的关系，比如:BWM is a car。抽象类包含并实现子类的通用特性，将子类存在差异化的特性进行抽象，交由子类去实现。</p>
<p>接口是对行为的抽象，表达的是like a的关系。比如Brid like a Aircraft，但其本质上is a Bird。接口的核心是定义行为，即实现类可以做什么，至于实现类主体是谁、是如何实现的，接口并不关心。</p>
<p>使用场景：当你关注一个事物本质的时候，用抽象类；当你关注一个操作的时候，用接口。</p>
<p>抽象类的功能要远超接口，但是定义抽象类的代码很高。因为高级语言来说(从实际设计上来说也是)每个类只能继承一个类。在这个类(抽象类)中，你必须继承或者编写出其所有子类所有共性，虽然接口在功能上会弱化很多，但是它只是针对一个动作的描述。而且你可以在一个类中同时实现多个接口。在设计上会降低难度。</p>
<h3 id="List和Set的区别"><a href="#List和Set的区别" class="headerlink" title="List和Set的区别"></a><strong>List和Set的区别</strong></h3><p>List:有序，按对象进入的顺序保存对象，可重复，允许多个NULL元素对象，可以使用Iterator取出所有元素，再逐一遍历，还可以使用get(int index)获取指定下标的元素。</p>
<p>Set:无序，不可重复，最多允许有一个NULL元素对象，取元素时只能用Iterator接口取出所有元素，再逐一遍历各个元素。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/wang-cheng/tags/%E9%9D%A2%E8%AF%95%E9%A2%98/" rel="tag"># 面试题</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/wang-cheng/2022/03/09/Spring%E6%95%B4%E5%90%88Mybatis/" rel="prev" title="Spring整合Mybatis">
      <i class="fa fa-chevron-left"></i> Spring整合Mybatis
    </a></div>
      <div class="post-nav-item">
    <a href="/wang-cheng/2022/03/18/%E9%9D%A2%E8%AF%95%E9%A2%98-%E4%BA%8C/" rel="next" title="面试题(二)">
      面试题(二) <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%9D%A2%E8%AF%95%E9%A2%98"><span class="nav-number">1.</span> <span class="nav-text">面试题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AC%AC%E4%B8%80%E5%A4%A9"><span class="nav-number">1.1.</span> <span class="nav-text">第一天</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Java%E7%B1%BB%E5%8A%A0%E8%BD%BD%E5%99%A8%E6%9C%89%E5%93%AA%E4%BA%9B"><span class="nav-number">1.1.1.</span> <span class="nav-text">Java类加载器有哪些</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#JDK%E3%80%81JRE%E3%80%81JVM%E4%B8%89%E8%80%85%E5%8C%BA%E5%88%AB%E5%92%8C%E8%81%94%E7%B3%BB"><span class="nav-number">1.1.2.</span> <span class="nav-text">JDK、JRE、JVM三者区别和联系</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#x3D-x3D-%E5%92%8Cequals"><span class="nav-number">1.1.3.</span> <span class="nav-text">&#x3D;&#x3D;和equals</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#final%E7%9A%84%E4%BD%9C%E7%94%A8%E3%80%81%E4%B8%BA%E4%BB%80%E4%B9%88%E5%B1%80%E9%83%A8%E5%86%85%E9%83%A8%E7%B1%BB%E5%92%8C%E5%8C%BF%E5%90%8D%E5%86%85%E9%83%A8%E7%B1%BB%E5%8F%AA%E8%83%BD%E8%AE%BF%E9%97%AE%E5%B1%80%E9%83%A8final%E5%8F%98%E9%87%8F"><span class="nav-number">1.1.4.</span> <span class="nav-text">final的作用、为什么局部内部类和匿名内部类只能访问局部final变量</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#final%E7%9A%84%E4%BD%9C%E7%94%A8"><span class="nav-number">1.1.4.1.</span> <span class="nav-text">final的作用</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E5%B1%80%E9%83%A8%E5%86%85%E9%83%A8%E7%B1%BB%E5%92%8C%E5%8C%BF%E5%90%8D%E5%86%85%E9%83%A8%E7%B1%BB%E5%8F%AA%E8%83%BD%E8%AE%BF%E9%97%AE%E5%B1%80%E9%83%A8final%E5%8F%98%E9%87%8F"><span class="nav-number">1.1.4.2.</span> <span class="nav-text">为什么局部内部类和匿名内部类只能访问局部final变量</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#String%E3%80%81StringBuffer%E3%80%81StringBuilder%E5%8C%BA%E5%88%AB%E4%BB%A5%E5%8F%8A%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF"><span class="nav-number">1.1.5.</span> <span class="nav-text">String、StringBuffer、StringBuilder区别以及使用场景</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%87%8D%E8%BD%BD%E5%92%8C%E9%87%8D%E5%86%99%E7%9A%84%E5%8C%BA%E5%88%AB"><span class="nav-number">1.1.6.</span> <span class="nav-text">重载和重写的区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%8E%A5%E5%8F%A3%E5%92%8C%E6%8A%BD%E8%B1%A1%E7%B1%BB%E7%9A%84%E5%8C%BA%E5%88%AB"><span class="nav-number">1.1.7.</span> <span class="nav-text">接口和抽象类的区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#List%E5%92%8CSet%E7%9A%84%E5%8C%BA%E5%88%AB"><span class="nav-number">1.1.8.</span> <span class="nav-text">List和Set的区别</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">王诚</p>
  <div class="site-description" itemprop="description">命运对勇士低语，你无法抵御风暴；勇士低声回应，我就是风暴</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/wang-cheng/archives/">
        
          <span class="site-state-item-count">32</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/wang-cheng/tags/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">王诚</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/wang-cheng/lib/anime.min.js"></script>
  <script src="/wang-cheng/lib/velocity/velocity.min.js"></script>
  <script src="/wang-cheng/lib/velocity/velocity.ui.min.js"></script>

<script src="/wang-cheng/js/utils.js"></script>

<script src="/wang-cheng/js/motion.js"></script>


<script src="/wang-cheng/js/schemes/pisces.js"></script>


<script src="/wang-cheng/js/next-boot.js"></script>




  















  

  

  

</body>
</html>
